The Distance formula is used to find the length of one side of the triangle. You feed the function 2 coordinates and it spits the distance of the line back to you.
Formula
distance =
The triangle symbol means change in. So the change in looks like x1-x2.
So if we were looking for the distance from (3,9) to (7,14)
It would look something like below:
This formula comes in handy because we can use it to check to see if the robot ever gets to where it wants to go. If the distance gets to zero the robot got to where it needs to go.
This can be a bit of a problem in real life because it can be impossible to get to exactly the same point as you have clicked which could mean that the robot just rocks back in forth trying to get to exactly the same point. The way that this can be resolved is to say that if the distance gets below 2 assume that the robot is where it needs to be.
Distance
Description
The Distance formula is used to find the length of one side of the triangle. You feed the function 2 coordinates and it spits the distance of the line back to you.Formula
distance =
The triangle symbol means change in. So the change in looks like x1-x2.
So if we were looking for the distance from (3,9) to (7,14)
It would look something like below:
This formula comes in handy because we can use it to check to see if the robot ever gets to where it wants to go. If the distance gets to zero the robot got to where it needs to go.
This can be a bit of a problem in real life because it can be impossible to get to exactly the same point as you have clicked which could mean that the robot just rocks back in forth trying to get to exactly the same point. The way that this can be resolved is to say that if the distance gets below 2 assume that the robot is where it needs to be.
That is distance in a nutshell.
More help can be found here.